package com.zc.redisson.stream.service;


import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * redis stream监听消息
 */
@Component
public class EnergyAlarmService {

    private final Logger logger = LoggerFactory.getLogger(EnergyAlarmService.class);

    @Autowired
    private RedisTemplate redisTemplate;


    @Autowired
    private RedissonClient redissonClient;


    public void onMessage(Map<String, String> valueMap) {
        try {
            logger.info("用能告警消息内容:{}",valueMap);
        }catch (Exception e){
            logger.error("用能告警处理异常",e);
        }
    }


}
